subroutine readdiff(lunit,t_array0,myrank)
  use param
  use data_param, &
       only:dffn,diff_exist,n_diff_data
  use label_data_param,only:n_obj_type
  use label_data_param,only:obj_type
  implicit none
  
  interface
     integer function str2label(str)
       character :: str*(*)
     end function str2label
  end interface

  integer,intent(in) :: lunit,t_array0(8),myrank

  integer :: nunit,count_line,len_str,asci_code
  character(len=len_linebuf) :: eatline
  character(len=len_wordbuf),dimension(max_n_word) :: eatword
  character(len=8) :: d_time_str

  integer :: i,lid,n,m

  if (.not.diff_exist) return

  nunit=1

  open(unit=nunit,file=dffn,status='old',err=103)

  count_line=0
  n=0
  do
     read(nunit,'(a)',end=100,err=101) eatline
     count_line=count_line+1
     len_str=len_trim(eatline)
     if (len_str.eq.0) cycle
     eatline=adjustl(eatline)
     asci_code=ichar(eatline(1:1))
     if (asci_code.eq.ccode) cycle
     read(eatline(1:len_str),*,end=102) &
          (eatword(i),i=1,max_n_word)
102  continue
     ! c1:label
     ! c2:Does it move?
     ! c3:Energy barrier
     ! c4:Prefactor
     lid=str2label(eatword(1))
     if (lid.eq.0) call abnormal_stop("readdiff",&
          "Unrecognized label is found in diff file.")
     n=n+1
     n_diff_data=n
     
     read(eatword(2),*) m
     
     if (m.eq.1) then
        obj_type(lid)%does_move=.true.
        read(eatword(3),*) obj_type(lid)%diff_eb
        read(eatword(4),*) obj_type(lid)%diff_nu
     end if

  end do

103 continue
  call abnormal_stop("readdiff",&
       "Error occurs while the diff file opens.")

101 continue
  call abnormal_stop("readdiff",&
       "Error occurs during readig the diff file.")

100 continue

  close(nunit)

  ! Print the label file info.
  call log_msg1(lunit,"")
  call log_msg1(lunit,"Message from the subourinte (readdiff)")
  call log_msg1(lunit,"")
  write(lunit,'(1x,i0,1x,"lines read from the ",a)') &
       count_line,trim(dffn)
  write(lunit,'(1x,"Number of diffusion data=",1x,i0)') &
       n_diff_data

  ! Write to the terminal and log file
  call print_d_time(t_array0,d_time_str)
  if (myrank.eq.0) &
       write(*,'(a8,":READDIFF DONE.")') d_time_str(1:8)
  write(lunit,*)
  write(lunit,'(a8,":READDIFF DONE.")') d_time_str(1:8)

  return

end subroutine readdiff
